<template>
<h1>单选框</h1>
  <el-radio-group v-model="gender">
    <el-radio label="男" value="1"></el-radio>
    <el-radio label="女" value="0"></el-radio>
  </el-radio-group>
  <h4>你选择的性别是:
    <span v-if="gender === '1'">{{ "男" }}</span>
    <span v-else>{{ "女" }}</span>
  </h4>
  <br>
  <el-radio-group v-model="game">
    <el-radio v-for="(item,index) in games" :label="item.title" :key="index" :value="item.title"></el-radio>
  </el-radio-group>
  <h4>你选择的游戏是:{{game}}</h4>
</template>

<script setup>
import {ref} from "vue";

const gender = ref("1");
const games = ref(
    [{title:'LOL',Url:'D/x1x'},
        {title:'DOC',Url:'D/x2x'},
        {title:'APEX',Url:'D/x3x'},
        {title:'W',Url:'D/x4x'},
        {title:'PUBG',Url:'D/x5x'}
      ]
);
const game=ref('');
</script>


<style scoped>

</style>